package com.qianfeng.smartplatform.pojo;

import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;

import java.io.Serializable;
import java.util.Date;

public class Humiture implements CheckEmptyInterface {
    private Long id;

    private String deviceId;

    private Double humidity;

    private Double temperature;

    private Date uploadTime;

    @Override
    public boolean isEmpty(CheckType checkType) {
        switch (checkType) {
            case ADD:
                return StringUtils.hasText(deviceId) || ObjectUtils.isEmpty(humidity) || ObjectUtils.isEmpty(temperature);
        }
        return CheckEmptyInterface.super.isEmpty(checkType);
    }

    private static final long serialVersionUID = 1L;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId == null ? null : deviceId.trim();
    }

    public Double getHumidity() {
        return humidity;
    }

    public void setHumidity(Double humidity) {
        this.humidity = humidity;
    }

    public Double getTemperature() {
        return temperature;
    }

    public void setTemperature(Double temperature) {
        this.temperature = temperature;
    }

    public Date getUploadTime() {
        return uploadTime;
    }

    public void setUploadTime(Date uploadTime) {
        this.uploadTime = uploadTime;
    }
}